<template>
    <div class="two">
        <div class="container">
            <!-- 进度条tab -->
            <tmptab :active="1"></tmptab>
            <!-- 可传入数据 -->
            <div class="info">
                <span>本次可导入</span>
                <span>数据:{{ all.success }}条</span>
            </div>
            <!-- 不可传入数据 -->
            <div class="info">
                <span>本次不可导入</span>
                <span>数据:{{ list.length }}条</span>
            </div>
            <div class="next">
                <button @click="next" :disabled="disabled">下一步</button>&nbsp;&nbsp;
                <button @click="prev">返回重新上传</button>
            </div>
            <div class="list">
                <Table
                    :loading="tableLoading"
                    border
                    stripe
                    :columns="columns1"
                    :data="list"
                ></Table>
            </div>
        </div>
    </div>
</template>
<script>
import tmptab from "./tmptab";
export default {
    components: {
        tmptab,
    },
    data() {
        return {
            list: [],
            columns1: [
                {
                    title: "编号",
                    key: "num",
                    align: "center",
                },
                { title: "医生姓名", key: "doctorName", align: "center" },
                { title: "医院名称", key: "hospitalName", align: "center" },
                { title: "医生手机号码", key: "phone", align: "center" },
                { title: "错误提示", key: "errorPrompt", align: "center" },
            ],
            all: {},
            disabled: true,
        };
    },
    created() {
        let breadList = [
            { path: "/index", title: "首页" },
            {
                path: "/index/maintain/indexManagement/index",
                title: "索引管理",
            },
            {
                path: "/index/doctorOperation/doctorregister/list",
                title: "医生注册信息",
            },
        ];
        this.$emit("changeBreadList", breadList);
    },
    mounted() {
        let fail = this.$route.params.fail;
        console.log(fail.fail);
        if (fail) {
            this.all = fail;
            this.list = fail.fail;
            this.disabled = false;
        }
    },
    methods: {
        //   下一步
        next() {
            let fail = this.$route.params.fail;
            let success = fail.success;
            let error = fail.fail.length;
            // FunctionJS公用方法
            this.functionJS.paramsNavgationTo(
                this,
                "doctorregisterbatchthree",
                {
                    success,
                    error,
                }
            );
        },
        //   上一步
        prev() {
            this.functionJS.paramsNavgationTo(this, "doctorregisterbatchone");
        },
    },
};
</script>
<style lang="less" scoped>
.two {
    margin-left: 1%;
    padding: 10px;
    width: 98%;
    background: #ffffff;
    box-sizing: border-box;
    .container {
        width: 100%;
        display: flex;
        flex-direction: column;
        .info {
            width: 60%;
            background: #fffbf6;
            padding: 20px 30px;
            margin: 20px auto;
        }
        .next {
            width: 100%;
            text-align: center;
            button {
                width: 100px;
                height: 30px;
                border: none;
                outline: none;
                background: #5362e1;
                border-radius: 4px;
                color: #fff;
            }
            button:nth-child(2){
                background: rgb(236, 90, 90);
            }
            span {
                margin-left: 20px;
                color: red;
                cursor: pointer;
            }
        }
        .list {
            width: 80%;
            margin: 10px auto;
            table {
                border: 1px solid #ddd;
                width: 100%;
                tr:nth-child(odd) {
                    background: #f8f8f9;
                }
                tr:nth-child(even) {
                    background: #fff;
                }
                tr:not(:first-child):hover {
                    background: #ebf7ff;
                }
                tr {
                    border-top: 1px solid #ddd;
                    height: 40px;
                    th {
                        text-align: center;
                    }
                }
            }
            .notData {
                width: 100%;
                text-align: center;
                border: 1px solid black;
                border-top: none;
            }
        }
    }
}
</style>
